import instance from "../request/request";
async function getShop() {
    const response = await instance.get('/shop');
    return response.data;
}
async function getAdd(data) {
    const response = await instance.post('/shop', data);
    return response.data;
}
async function getDelete(id) {
    const response = await instance.delete('/shop/' + id);
    return response.data;
}
async function getUpdate(id, data) {
    return await instance.patch(`/shop/${id}`, data);
}
async function getLook(obj) {
    const searchURL = new URLSearchParams(obj).toString()
    console.log(searchURL)
    return await instance.get(`/shop?${searchURL}`)
}
async function getXiang(id) {
    return await instance.get(`/shop/${id}`)
}
export { getShop, getAdd, getDelete, getUpdate, getLook, getXiang }